package com.mzj.saas.mservice.department.repository;


import com.mzj.saas.mservice.department.entity.UserDepartmentRef;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserDepartmentRefRepository extends PagingAndSortingRepository<UserDepartmentRef, Long>, JpaSpecificationExecutor<UserDepartmentRef>, JpaRepository<UserDepartmentRef, Long> {

    @Transactional
    void deleteAllByUserId(String userId);

    List<UserDepartmentRef> findByDepId(Long depId);

    List<UserDepartmentRef> findByUserId(String userId);

    List<UserDepartmentRef> findByUserIdIn(List<String> userIds);
}
